package com.fwj.user.strategy.impl;

import com.fwj.core.common.config.SpringContextHolder;
import com.fwj.core.common.model.ResponseDTO;
import com.fwj.user.api.user.UserService;
import com.fwj.user.entity.user.UserBaseInfo;
import com.fwj.user.model.user.UserDetailsInfo;

/**
 * @Author: fwj
 * @Data: 2022/4/19 21:45
 * @Version 1.0
 * @Description:
 */


public enum UserStrategyImpl {



    PERSONAL_INTERFACE{
        private UserService userService = SpringContextHolder.getBean(UserService.class);

        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) throws Exception {
            UserBaseInfo userBaseInfo = userDetailsInfo.getUserBaseInfo();
            return (ResponseDTO) userService.savePersonalInfo(userBaseInfo);
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) throws Exception {
            UserBaseInfo userBaseInfo = userDetailsInfo.getUserBaseInfo();
            return (ResponseDTO) userService.getPersonalInfo(userBaseInfo);
        }
    },

    PROFILE_PHOTO{
        private UserService userService = SpringContextHolder.getBean(UserService.class);
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return (ResponseDTO) userService.saveProfilePhoto(userDetailsInfo);
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },

    ACHIEVEMENT{
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return null;
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },

    ACCOUNT_SECURITY{
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return null;
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },

    LOGIN_RECORD{
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return null;
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },

    REAL_NAME_AUTHENTICATION{
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return null;
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },

    MY_WALLET{
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return null;
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },

    CREATIVE_CENTER{
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return null;
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },

    MY_VIP{
        @Override
        public ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) {
            return null;
        }

        @Override
        public ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) {

            return null;
        }
    },
    ;
    //定义抽象方法，执行更新
    public abstract ResponseDTO execUpdate(UserDetailsInfo userDetailsInfo) throws Exception;
    //查询
    public abstract ResponseDTO execQuery(UserDetailsInfo userDetailsInfo) throws Exception;
}
